package tt.dz.appserver.dao.ext;

import java.util.List;

import org.apache.commons.collections.map.ListOrderedMap;
import org.springframework.stereotype.Repository;

import tt.dz.appserver.dao.base.BasisDao;
import tt.dz.appserver.entity.model.pub.Comment;


/**
 * 通用评论操作Dao
 * @author Administrator
 *
 */
@Repository
public class CommentDao extends BasisDao<Comment>{
	
	/**评论删除*/
	public int delPubComment(Comment comment) {
		
		return super.update(comment);
		
	};
		
	/**评论查询*/
	public List<Comment> findPubCommentValid(Integer associatetype, String associateid) {
		
		Integer validflag = 1;
		ListOrderedMap map = new ListOrderedMap();
		map.put("associated_type", associatetype);
		map.put("associated_id", associateid);
		map.put("valid_flag", validflag);
		
		return super.findListAutomaticOfClass(Comment.class, map, null, null, 
				"comment_time", 2);
		
	}
	
	
}
